package com.joysuch.wwyt.workflow.enums;

/**
 * @Author ZhangDong
 * @Date 2020/11/9 17:40
 */
public enum WorkFlowShowTypes {

    BUSINESS_RANGE(0, "业务时间范围"),
    FLOW_NODE_RANGE(1, "流程节点范围"),
    PERMANENT_SHOW(2, "永久显示"),
    //只对电子围栏报警生效
    TIME_COMPONENT_RANGE(3, "时间组件范围");

    private Integer index;
    private String type;

    WorkFlowShowTypes(Integer index, String type) {
        this.index = index;
        this.type = type;
    }

    public Integer getIndex() {
        return index;
    }

    public String getType() {
        return type;
    }

    public Integer getIndex(String type) {
        WorkFlowShowTypes[] values = WorkFlowShowTypes.values();
        for (WorkFlowShowTypes value : values) {
            if (value.type.equals(value.type)) {
                return value.index;
            }
        }
        return null;
    }

}
